package com.li.sqlparse.factory;

import com.li.sqlparse.service.SqlParseHelperService;
import com.li.sqlparse.service.SqlParseService;
import com.li.sqlparse.service.impl.MysqlSqlParseServiceImpl;
import com.li.sqlparse.service.impl.SqlParseHelperServiceImpl;

/**
 * @author LiDong
 * @version 1.0.0
 * @className SqlParseFactory.java
 * @createTime 2021年06月04日 20:18:00
 */
public class SqlParseFactory {

    /**
     * Mysql
     */
    private static final String MYSQL = "mysql";


    /**
     * sql解析 工厂
     */
    private static SqlParseFactory sqlParseFactory;


    private SqlParseFactory() {

    }

    /**
     * 线程安全
     *
     * @return SqlParseFactory
     */
    public static synchronized SqlParseFactory getInstance() {
        if (sqlParseFactory == null) {
            sqlParseFactory = new SqlParseFactory();
        }
        return sqlParseFactory;
    }

    /**
     * @param dbType
     * @return
     */
    public SqlParseService getSqlParseService(String dbType) {
        return new MysqlSqlParseServiceImpl();
    }

    public SqlParseHelperService getSqlParseHelperService() {
        return new SqlParseHelperServiceImpl();
    }
}
